package base;

import java.net.MalformedURLException;
import java.net.URL;

import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeClass;

import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;

public class BaseDriver {
	public  AndroidDriver<AndroidElement>  driver=null;
	String urlStr = "http://127.0.0.1:4723/wd/hub";
	@BeforeClass
	public void initApp() throws MalformedURLException, InterruptedException {
		URL url = new URL(urlStr);
		DesiredCapabilities cap=new DesiredCapabilities();
		cap.setCapability("deviceName", "STSDU19C26003698");
		cap.setCapability("platformName", "Android");
		cap.setCapability("appPackage", "com.example.petwithlove");
		cap.setCapability("appActivity", ".login.PasswordLogin");
		
		driver=new AndroidDriver<AndroidElement>(url,cap);
		Thread.sleep(1000);
	}
	
//	@AfterMethod
//	public void quitApp() {
//		if(driver!=null) {
//			driver.quit();
//		}
		
//	}

}
